<?php

namespace App\Transformers;

use App\Models\Collect;
use League\Fractal\TransformerAbstract;
use App\Models\MovieWatchUser;
class ExploreTransformer extends TransformerAbstract
{
    protected $availableIncludes = ['movie', 'user'];

    public function transform(MovieWatchUser $explore)
    {
        return [
            'status' => $explore->status,
            'created_at' => (string) $explore->created_at,
            'updated_at' => (string) $explore->updated_at,
            'count' => $explore->count,
        ];
    }

    public function includeMovie(MovieWatchUser $explore)
    {
        return $this->item($explore->movie, new MovieTransformer);
    }
    public function includeUser(MovieWatchUser $explore)
    {
        return $this->item($explore->user, new UserTransformer);
    }
}
